home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / src / devtools / flex-2.5.4.tar.gz / flex-2.5.4.tar / flex-2.5.4 / MISC / Borland / Makefile < prev    next >
Makefile  |  1995-03-28  |  4KB  |  164 lines

  1. ###############################################################################
  2. # Makefile for flex 2.5.0.6 (beta) with Borland C/C++ version 4.02
  3. #
  4. # This will probably need to be adjusted for your existing lexer/parser
  5. # generators.  See definitions for FLEX and YACC near the bottom of the
  6. # makefile.
  7. #
  8. # This makefile builds initflex.exe and flex.exe by default.  It
  9. # removes initflex.exe after making flex.exe.  After that, you may
  10. # choose to try alternate compression options for your everyday flex
  11. # executable.
  12. #
  13. # This will build flex with the large model.  Don't use huge, but if you
  14. # feel like experimenting with other models, post your success stories to 
  15. # comp.compilers, OK?
  16. #
  17. # This makefile does *not* implement the big testing found in "makefile.in".
  18. #
  19. # I also assume the availability of sed and the gnu file utilities on the
  20. # system - they're readily available, so if you don't have them, why not?
  21. #                                                                 <grin>
  22. #
  23. # The resulting generated lexer (the real goal, right?) will compile
  24. # (and run nicely, too) as a .c file, as well as being included such as
  25. # extern "C" { #include "lexyyc" } in a .cplusplus file.
  26. #
  27. ###############################################################################
  28.  
  29. DEBUG = 1
  30.  
  31. .autodepend
  32.  
  33. all:    initflex.exe flex.exe
  34.     rm initflex.exe initflex.map
  35.  
  36. ###############################################################################
  37. #
  38. # standard utilitities? ha.
  39. #
  40.  
  41. CC    = bcc
  42. CPP     = bcc
  43.  
  44. ###############################################################################
  45. #
  46.  
  47. MODEL    = l
  48.  
  49. !if $(DEBUG) == 1
  50. !message Building with debug.
  51. debugCompile = -v
  52. debugLink = /v
  53. !else
  54. !message Building without debug.
  55. debugCompile =
  56. debugLink =
  57. !endif
  58.  
  59. LOADER    = c0$(MODEL).obj
  60. LIBS    = c$(MODEL).lib
  61. LINKFLAGS = $(debugLink)
  62.  
  63. DATASEG    = -dc -Ff
  64. SizeOPT    = -Os -G-
  65. Defines =
  66.  
  67. COMMON    = -A -c -m$(MODEL) $(SizeOPT) $(DATASEG) $(Defines) $(debugCompile)
  68. CFLAGS  = -o$@ $(COMMON)
  69. CCFLAGS  = -o$@ $(COMMON) -Pcc
  70.  
  71. ###############################################################################
  72.  
  73. .SUFFIXES:    .cc
  74.  
  75. .cc.obj:
  76.     $(CPP) $(CCFLAGS) $<
  77.  
  78. .c.obj:
  79.     $(CPP) $(CFLAGS) $<
  80.  
  81. ###############################################################################
  82. #
  83. # source & object files
  84. #
  85.  
  86. BASESRC = ccl.c dfa.c ecs.c gen.c main.c misc.c nfa.c parse.c \
  87.     sym.c tblcmp.c yylex.c skel.c
  88.  
  89. INITSRC = $(BASESRC) initscan.c
  90.  
  91. INITOBJS = $(INITSRC:.c=.obj)
  92.  
  93. SRC = $(BASESRC) scan.c
  94.  
  95. OBJS = $(SRC:.c=.obj)
  96.  
  97. objects:    $(OBJS)
  98.     @echo $(OBJS)
  99.  
  100. ###############################################################################
  101. #
  102. # Executable
  103. #
  104.  
  105. initflex.exe:      $(INITOBJS)
  106.     tlink $(LINKFLAGS) @&&!
  107. $(LOADER) $**
  108. $&.exe
  109.  
  110. $(LIBS)
  111. !
  112.  
  113. flex.exe:      $(OBJS)
  114.     tlink $(LINKFLAGS) @&&!
  115. $(LOADER) $**
  116. $&.exe
  117.  
  118. $(LIBS)
  119. !
  120.  
  121. ###############################################################################
  122. #
  123. # Lex files
  124. #
  125.  
  126. FLEX    = .\initflex
  127. FLEX_FLAGS = -ist
  128.  
  129. scan.c: scan.l
  130.     $(FLEX) $(FLEX_FLAGS) scan.l >scan.tmp
  131.     sed s,\"$(srcdir)/scan.l\",\"scan.l\", <scan.tmp >scan.c
  132.     @rm scan.tmp
  133.  
  134. ###############################################################################
  135. #
  136. # YACC files
  137. #
  138.  
  139. YACC    = .\bison
  140. YFLAGS  = -vdyl
  141.  
  142. parse.c: parse.y
  143.     $(YACC) -ydl parse.y
  144.     @sed "/extern char.*malloc/d" <y_tab.c >parse.c
  145.     @rm -f y_tab.c
  146.     @mv y_tab.h parse.h
  147.  
  148. ###############################################################################
  149. #
  150. # cleanup
  151. #
  152.  
  153. clean:
  154.     -rm *.obj *.map initflex.exe
  155.  
  156. realclean:    clean
  157.     -rm flex.exe
  158.  
  159. #
  160. # end Makefile
  161. #
  162. ###############################################################################
  163.